package org.jash.shop2112.database

import androidx.room.Dao
import androidx.room.Query
import androidx.room.Upsert
import org.jash.shop2112.entity.Goods

@Dao
interface GoodsDao {
    @Upsert
    suspend fun save(vararg goods: Goods)
    @Query("select * from goods")
    suspend fun findAll():List<Goods>
    @Query("select * from goods where id = :id")
    suspend fun findById(id:Int):Goods
    @Query("select * from goods where goods_desc like :keyword")
    suspend fun search(keyword:String):List<Goods>
}